package com.company.card_service.controller;


import com.company.card_service.model.Employee;
import com.company.card_service.util.AliOssCloudUtil1;
import com.company.card_service.vo.Result;
import com.company.card_service.vo.ResultCodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = "文件上传等等接口")
@RestController
@RequestMapping("/manager/load")
@Slf4j
public class loadController {

    @Autowired
    private AliOssCloudUtil1 aliOssCloudUtil1;

    @ApiOperation("文件上传接口")
    @PostMapping("/loadImage")
    public Result loadImage(@RequestParam(value = "file") MultipartFile file){
        log.info("www2");
        String s = aliOssCloudUtil1.uploadFile(file);
        return Result.success(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMessage(),s);
    }
}
